<html>
<head><meta charset="utf-8"><title>Newbie help · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Newbie.20help.html">Newbie help</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="199070071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Newbie%20help/near/199070071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kon / GolDDranks <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Newbie.20help.html#199070071">(May 28 2020 at 19:25)</a>:</h4>
<p>Hi, sorry if this thread is in wrong place. Just hoping to get quick answers for newbish questions when hacking on the compiler</p>



<a name="199070542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Newbie%20help/near/199070542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kon / GolDDranks <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Newbie.20help.html#199070542">(May 28 2020 at 19:27)</a>:</h4>
<p>I'm trying to improve a lint. Currently there's a span that could be narrower. So, I have a const definition like const A: bool = true; I also have a def_id of that definition. At the moment the span points to the whole definition. The thing I'm trying to get is the span of the item A itself. How can I do that?</p>



<a name="199070701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Newbie%20help/near/199070701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kon / GolDDranks <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Newbie.20help.html#199070701">(May 28 2020 at 19:28)</a>:</h4>
<p>My speculation is that I'd try to get a HirId of A (I presume it is a kind of node that has an HirId), and then somehow get it's associated span. Does that sound correct? What are the APIs I need to call?</p>



<a name="199071824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Newbie%20help/near/199071824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Newbie.20help.html#199071824">(May 28 2020 at 19:34)</a>:</h4>
<p>Do you want the span of the identifier <code>A</code>?</p>



<a name="199121550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Newbie%20help/near/199121550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kon / GolDDranks <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Newbie.20help.html#199121550">(May 29 2020 at 07:27)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> yes, that's correct</p>



<a name="199145423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Newbie%20help/near/199145423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Newbie.20help.html#199145423">(May 29 2020 at 12:14)</a>:</h4>
<p>You should be able to use the HIR map to get the HIR node, which can give you the <code>Ident</code>, and that has a span you can use</p>



<a name="199187758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Newbie%20help/near/199187758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Kon / GolDDranks <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Newbie.20help.html#199187758">(May 29 2020 at 17:46)</a>:</h4>
<p>I'll see! Thanks.</p>



<a name="199233636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Newbie%20help/near/199233636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pickfire <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Newbie.20help.html#199233636">(May 30 2020 at 02:36)</a>:</h4>
<p>Hi, I heard that I can ping this channel to get help to try <a href="https://github.com/rust-lang/rust/pull/72734#pullrequestreview-421079261">https://github.com/rust-lang/rust/pull/72734#pullrequestreview-421079261</a> on rust-timer. Can anyone please help me on that?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>